package com.lori.netshop.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import com.lori.netshop.service.ItemParamItemService;

@Controller
public class ItemParamItemContorller {
	//注入
	@Autowired
	private ItemParamItemService itemParamItemServiceimp;
	
	@RequestMapping("/testtt/{itemid}")
	public void test(@PathVariable long itemid,HttpServletResponse response){
		String html = itemParamItemServiceimp.find(itemid);
		response.setCharacterEncoding("utf-8");
		response.setContentType("text/html");
		PrintWriter writer;
		try {
			writer = response.getWriter();
			writer.print(html);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
